package com.caocaog.market.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 商品促销信息
 *
 * @author chechen
 * @date 2021-11-20
 */
@Data
@NoArgsConstructor
@TableName("mk_shop_promo")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "mk_shop_promo对象", description = "商品促销信息", parent = ShopPromoBase.class)
public class ShopPromo extends ShopPromoBase implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "ID")
    private String id;

    @TableLogic
    @ApiModelProperty(value="是否删除", hidden = true)
    private Integer delFlag;

    public ShopPromo(ShopPromoBase shopPromoBase) {
        super(shopPromoBase);
    }

    public ShopPromo(ShopPromoHis shopPromoHis) {
        super(shopPromoHis);
        this.id = shopPromoHis.getShopPromoId();
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间起始", hidden = true)
    private transient LocalDate createDateFrom;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间结束", hidden = true)
    private transient LocalDate createDateTo;
    @ApiModelProperty(value = "分站名称", hidden = true)
    private transient String siteName;
    @ApiModelProperty(value = "商家名称", hidden = true)
    private transient String merchantName;
}
